import { PluginCommand } from "./PluginCommand";
import { materialLibraryManager } from "../views/WorkAreaComponents/MaterialLibraryManager/MaterialLibraryManager";

class MaterialLibraryCommand extends PluginCommand{
  //上传文件
  // parseExcel(params,cb){
  //   if(this.toolQuery){
  //     this.toolQuery.parseExcelFile(params).then(res => {
  //       cb(res.data);
  //     })
  //   }
  // }
  getMaterialLibraryDate(cb){
    materialLibraryManager.getMaterialLibraryData(tableData => {
      cb(tableData)
    })
  }
  addMaterialLibraryItem(info,cb){
    materialLibraryManager.addMaterialLibraryItem(info,tableData => {
      cb(tableData)
    })
  }
  deleteMaterialLibraryItem(id,cb){
    materialLibraryManager.deleteMaterialLibraryItem(id,tableData => {
      cb(tableData)
    })
  }
  updateMaterialLibraryItem(info,cb){
    materialLibraryManager.updateMaterialLibraryItem(info,tableData => {
      cb(tableData)
    })
  }
  queryMaterialLibraryList(keyWords,cb){
    materialLibraryManager.queryMaterialLibraryList(keyWords,tableData => {
      cb(tableData)
    })
  }

}
const materialLibraryCommand = new MaterialLibraryCommand();
export { materialLibraryCommand }
